'''多进程检测头部，然后使用检测结果制作数据集'''
from multiprocessing import Process, Manager, Value

from cjc.tracker.trackerv7  import processor_run_tracker

from cjc.ws_server.ws_client import processor_run_ws_server

from cjc import project_setting

if __name__ == '__main__':

    with Manager() as manger:
        track_result_queue = manger.Queue(30)
        can_track = Value("i",project_setting.track_on_start)  # 是否追踪 ，0 False 1
        main_tracker = Process(target=processor_run_tracker, args=(track_result_queue, can_track))
        p_ws_server = Process(target=processor_run_ws_server, args=(track_result_queue, can_track))  # 接受queue消息
        ps = [main_tracker, p_ws_server]

        for p in ps:
            p.start()
        for p in ps:
            p.join()
